<template>
  <div class="list-container">
    <div class="search-panel" style="padding: 10px 20px">
      <el-row>
        <el-breadcrumb
          style="display:inline-block;margin-right:30px；height: 38px;line-height: 38px;"
        >
          <el-breadcrumb-item
            >当前角色：{{this.$route.query.roleName}}</el-breadcrumb-item
          >
        </el-breadcrumb>
      
      </el-row>
    </div>
    <div class="table-panel">
      <el-row class="table-operate select-mode row">
        <div
          :class="!dataAuthorization ? 'item  color-1ABC9C' : 'item'"
          @click="dataAuthorization = false"
        >
          功能授权
          <!-- <router-link to="/functionAuthorization"> 功能授权</router-link> -->
        </div>
        <div
          :class="dataAuthorization ? 'item  color-1ABC9C' : 'item'"
          @click="dataAuthorization = true"
        >
          数据容量
          <!-- <router-link to="/dataAuthorization"> 数据授权</router-link> -->
        </div>
      </el-row>
      <div class="authorization">
        <data-authorization  v-if="dataAuthorization"></data-authorization>
        <function-authorization @changeKey="changeKey" v-if="!dataAuthorization"></function-authorization>
        <!-- <router-view></router-view> -->
      </div>
    </div>
  </div>
</template>

<script>
import DataAuthorization from './dataAuthorization.vue'
import FunctionAuthorization from '../../tenroles/distribute.vue'
export default {
  components:{DataAuthorization,FunctionAuthorization},
  data() {
    return {
      dataAuthorization: false,
      department:'工资结算1部',
    };
  },
  methods: {
    changeKey(res) {
      this.dataAuthorization = res
    }
  },
  created(){
    console.log(this.$route.query.roleName);
  }
};
</script>

<style lang="scss" scoped>
.row {
  display: flex;
  flex-direction: row;
}
.select-mode {
  height: 45px;
  justify-content: center;
  .item {
    height: 35px;
    line-height: 35px;
    background-color: #bbbbbb;
    color: #ffffff;
    width: 110px;
    text-align: center;
    margin: 10px 0;
    font-size: 12px;
  }
  .item:hover {
    cursor: pointer;
  }
  .color-1ABC9C {
    background-color: #1abc9c;
    color: #ffffff;
  }
}
</style>
